package com.gopay.common.domain.cps;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.gopay.common.domain.BaseEntity;

/**
 * @CpsOrderAdjustRecord.java
 * @author xiefei
 * @2013-8-5 下午1:58:09 www.gopay.com.cn Inc.All rights reserved.
 * 
 */
@Entity
@Table(name = "CPS_ORDER_ADJUST_RECORD")
public class CpsOrderAdjustRecord extends BaseEntity {

    /**
	 * 
	 */
    private static final long serialVersionUID = 416429996070552618L;

    /**
     * 记录编号
     */
    private Long seqNo;

    /**
     * 银行订单号 BIS_BANK_ORDER的GOPAY_OUT_ORDER_ID
     */
    private String gopayOutOrderId;

    /**
     * 银行记录金额
     */
    private BigDecimal bankRecordAmt;

    /**
     * 银行记录状态 S: 成功
     */
    private String bankRecordStatus;

    /**
     * 文件上传时间
     */
    private Date fileUploadTime;

    /**
     * 对账结果 00: 成功 01: 失败 02: 无此订单 03:未发起 04:不处理
     */
    private String adjustResult;

    /**
     * 对账发起时间
     */
    private Date adjustTime;

    /**
     * 未对账前的交易状态 同CPS_GEN_MAIN_ORDER表TXN_STA_CD
     */
    private int origOrderStatus;

    /**
     * 国付宝系统订单号
     */
    private String gopayOrderId;

    /**
     * 对账次数
     */
    private int adjustCounts;

    /**
     * 上传文件操作者
     */
    private String uploadFileOperId;

    /**
     * 手工点击对账操作者
     */
    private String manualAdjustOperId;

    /**
     * 备注1
     */
    private String remark;

    /**
     * 记录最终修改用户ID
     */
    private String lastUpdUserId;

    /**
     * 最终修改时间
     */
    private Date lastUpdTime;

    /**
     * 最终修改交易代码
     */
    private String lastUpdTansCode;

    /**
     * 对账结果枚举
     * 
     * @CpsOrderAdjustRecord.java
     * @author yaobo
     * @2013-11-8 上午10:11:53 www.gopay.com.cn Inc.All rights reserved.
     */
    public enum AdjustResult {
        /**
         * 成功
         */
        SUCCESS("00"),
        /**
         * 失败
         */
        FAIL("01"),
        /**
         * 无此订单
         */
        BANKORDER_NULL("02"),
        /**
         * 未发起
         */
        UN_PROCESS("03"),
        /**
         * 不处理
         */
        NO_PROCESS("04"),
        /**
         * 处理中
         */
        PROCESSING("05");

        public String value;

        private AdjustResult(String value) {
            this.value = value;
        }
    }

    @Id
    @SequenceGenerator(name = "CpsOrderAdjustRecordSequence", sequenceName = "CPS_ORDER_ADJUST_RECORD_SEQ", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CpsOrderAdjustRecordSequence")
    @Column(name = "SQ")
    public Long getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(Long seqNo) {
        this.seqNo = seqNo;
    }

    @Column(name = "GOPAY_OUT_ORDER_ID", nullable = false, length = 30)
    public String getGopayOutOrderId() {
        return gopayOutOrderId;
    }

    public void setGopayOutOrderId(String gopayOutOrderId) {
        this.gopayOutOrderId = gopayOutOrderId;
    }

    @Column(name = "BANK_RECORD_AMT", nullable = false, precision = 20)
    public BigDecimal getBankRecordAmt() {
        return bankRecordAmt;
    }

    public void setBankRecordAmt(BigDecimal bankRecordAmt) {
        this.bankRecordAmt = bankRecordAmt;
    }

    @Column(name = "BANK_RECORD_STATUS", nullable = false, length = 1)
    public String getBankRecordStatus() {
        return bankRecordStatus;
    }

    public void setBankRecordStatus(String bankRecordStatus) {
        this.bankRecordStatus = bankRecordStatus;
    }

    @Column(name = "FILE_UPLOAD_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getFileUploadTime() {
        return fileUploadTime;
    }

    public void setFileUploadTime(Date fileUploadTime) {
        this.fileUploadTime = fileUploadTime;
    }

    @Column(name = "ADJUST_RESULT", length = 2)
    public String getAdjustResult() {
        return adjustResult;
    }

    public void setAdjustResult(String adjustResult) {
        this.adjustResult = adjustResult;
    }

    @Column(name = "ADJUST_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getAdjustTime() {
        return adjustTime;
    }

    public void setAdjustTime(Date adjustTime) {
        this.adjustTime = adjustTime;
    }

    @Column(name = "ORIG_ORDER_STATUS", length = 5)
    public int getOrigOrderStatus() {
        return origOrderStatus;
    }

    public void setOrigOrderStatus(int origOrderStatus) {
        this.origOrderStatus = origOrderStatus;
    }

    @Column(name = "GOPAY_ORDER_ID", length = 30)
    public String getGopayOrderId() {
        return gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Column(name = "ADJUST_COUNTS", length = 1)
    public int getAdjustCounts() {
        return adjustCounts;
    }

    public void setAdjustCounts(int adjustCounts) {
        this.adjustCounts = adjustCounts;
    }

    @Column(name = "UPLOAD_OPER_ID", length = 6)
    public String getUploadFileOperId() {
        return uploadFileOperId;
    }

    public void setUploadFileOperId(String uploadFileOperId) {
        this.uploadFileOperId = uploadFileOperId;
    }

    @Column(name = "MANUAL_ADJUST_OPER_ID", length = 30)
    public String getManualAdjustOperId() {
        return manualAdjustOperId;
    }

    public void setManualAdjustOperId(String manualAdjustOperId) {
        this.manualAdjustOperId = manualAdjustOperId;
    }

    @Column(name = "REMARK1", length = 30)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(name = "LAST_UPD_USER_ID", length = 10)
    public String getLastUpdUserId() {
        return lastUpdUserId;
    }

    public void setLastUpdUserId(String lastUpdUserId) {
        this.lastUpdUserId = lastUpdUserId;
    }

    @Column(name = "LAST_UPD_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTime() {
        return lastUpdTime;
    }

    public void setLastUpdTime(Date lastUpdTime) {
        this.lastUpdTime = lastUpdTime;
    }

    @Column(name = "LAST_UPD_TANS_CODE", length = 10)
    public String getLastUpdTansCode() {
        return lastUpdTansCode;
    }

    public void setLastUpdTansCode(String lastUpdTansCode) {
        this.lastUpdTansCode = lastUpdTansCode;
    }

    public CpsOrderAdjustRecord() {
        super();
        // TODO Auto-generated constructor stub
    }

}
